/*
 * @Author: 0x9DEFA478
 * @Date: 2022-02-13 19:02:56
 * @LastEditTime: 2022-02-19 21:49:20
 * @LastEditors: 0x9DEFA478
 * @Description: 
 * QQ:2652450237
 * ============================================================================================================================================
 * 
 * 
 * 
 *                                                                                               ************      ****************************
 *                                                                                             ************      ****************************  
 *                                                                                           ************      ****************************    
 *                                                                                         ************      ****************************      
 *                                                                                       ************      ************                        
 *                                                                                     ************      ************                          
 *                                                                                   ************      ************                            
 *                                                                                 ************      ************                              
 *                                                                               ************      ************                                
 *                                                                             ************      ************                                  
 *                                                                           ************      ************                                    
 *                                                                         ************      ************                                      
 *                                                                       ************      ************                                        
 *                                                                     ************      ************                                          
 *                                                                   ************      ************                                            
 *                                                                 ************      ************                                              
 *                                                               ************      ************                                                
 *                                                             ************      ************                                                  
 *                                                           ************      ************                                                    
 *                                                         ************      ************                                                      
 *                                                       ************      ************                                                        
 *                                                     ************      ************                                                          
 *                                                   ************      ************                                                            
 *                                                 ************      ************                                                              
 *                                               ************      ************                                                                
 *                                             ************      ************                                                                  
 *                                           ************      ************                                                                    
 *                                         ************      ************                                                                      
 *                                       ************      ************                                                                        
 *                                     ************      ************                                                                          
 *                                   ************      ************                                                                            
 *                                 ************      ************                                                                              
 *                               ************      ************                                                                                
 *                             ************      ************                                                                                  
 *                           ************      ************                                                                                    
 *                         ************      ************                                                                                      
 *       ****************************      ************                                                                                        
 *     ****************************      ************                                                                                          
 *   ****************************      ************                                                                                            
 * ****************************      ************                                                                                              
 * 
 * 
 * 
 * ============================================================================================================================================
 * 
 */
#include "./H_NES_Console.h"
#include "../ConstString/H_NES_ConstString.h"




void H_NES_PPU_Reset(H_NES_Console* Console){
  int i;

  Console->PPU.Register.Internal.IsAddXY=-1;
  Console->PPU.Register.Internal.t=0U;
  Console->PPU.Register.Internal.v=0U;
  Console->PPU.Register.Internal.x=0U;
  Console->PPU.Register.Internal.w=0U;

  Console->PPU.Register.Register[vH_NES_PPU_Register_PPUCTRL]=0x00U;
  Console->PPU.Register.Register[vH_NES_PPU_Register_PPUMASK]=0x00U;
  Console->PPU.Register.Register[vH_NES_PPU_Register_PPUSTATUS]=0x00U;

  Console->PPU.Register.PPUDATA.ReadBuffer=0x00U;


  Console->PPU.Renderer.IsOddFrame=0;
  for(i=0;i<32;i++){
    Console->PPU.Renderer.LineBuffer_Background[i]=0U;

    Console->PPU.Renderer.SubOAMInfo[i].ExistSprite0=0U;
    Console->PPU.Renderer.SubOAMInfo[i].OAM_Count=0U;

    Console->PPU.Palettes[i]=0U;
  }

  for(i=0;i<256;i++){
    Console->PPU.OAM[i]=0U;
  }

}



